home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 25 / Cream of the Crop 25.iso / utility / ffe101.zip / MOD.SWG / 0007_FNK.pas < prev    next >
Pascal/Delphi Source File  |  1996-09-04  |  9KB  |  222 lines

  1.  
  2. FNK FORMAT
  3. ----------
  4.  
  5. FUNKTRACKER HEADER
  6. ------------------
  7.  
  8. sig       0 | 4 | preamble set to "Funk"
  9. info      4 : 4 | this word contains the following packed info:
  10.  
  11.  
  12. 0 0 0 0 0 0 0 0   1 1 1 1 1 1 1 1   2 2 2 2 2 2 2 2   3 3 3 3 3 3 3 3
  13. \-day---/ \month--/ \----year---/   \-card/ \-CPU-/   | 0 0 0 0 0 0 0
  14.                                                       | \memory reqi/
  15.                                                       |    (256Kb x)
  16.                                        16 bit = 1 ----
  17.  
  18. (NB/  the  appearance  is as if you  see  it  in a sector editor...Least
  19. significant  bits  first to most significant  bits...  which is in INTEL
  20. format anyways. unless you have some other computer like a SUN or a DEC,
  21. you can easyerly extract each value with some AND's and SHR's).
  22.  
  23. cpu:  0 = Unknown
  24.       1 = IBM ????
  25.       2 = IBM ????
  26.       3 = Intel386
  27.       4 = Intel486
  28.       5 = Pentium
  29. card:
  30.       0 = SB 2.0
  31.       1 = SB PRO
  32.       2 = GUS v<>
  33.       3 = SB Compatable
  34.       4 = SB 16
  35.       5 = GUS f<>
  36.       6 = Ripped/converted from another format
  37.       7 = Pro Audio
  38.  
  39. is  in summary it tells you the date  the file was created, the card and
  40. cpu it was created on, and the memory requirements the song needs.
  41.  
  42. NB/  if  this  is  confusing you then  don't  worry  about  it. it's not
  43. essential  to extract info from here inorder to play it. it's purpose is
  44. purely statistical.
  45.  
  46. LZH_check_size   8 : 4 | this is the file size. if you load a song that's
  47.                          size thats different from this number, then you
  48.                          know it is corrupt in some way. it would be
  49.                          highly recommended not to play it.
  50.  
  51. LZH_check_sum    12 | 4 | This field (pre-release versions 1.04 a below
  52.                           was used as a provisional 4 byte checksum field.
  53.                           Now it is used for FNK charactristics:
  54.  
  55.  Format: - "Fk**" for fixed channeling or
  56.            "Fv**" for variable channeling
  57.  
  58. The ** is a dec number ranging from 0 to 99. For example, if the song is
  59. a 32 channel module, then the preamble is "Fk32". 10 Channels is "Fk10".
  60.  
  61. if  you  see garble in this field, then  you  know it was created on a <
  62. 1.05  editor.  you  can safely assume that  this  is  a 8 channel, fixed
  63. channel module.
  64.  
  65. loop_order      13  | 1 | if this field is set to 0ffh, then the song won't
  66.                           loop back. That is, when it has finished playing
  67.                           the last pattern in the order list, it will stop.
  68.  
  69.                           if the value is anything other than this (0 - 7fh),
  70.                           then the tracker will loop back to order number in
  71.                           this field and commence playing the patterns at
  72.                           that order number.
  73.  
  74.  
  75. order_list      14  | 256 | this is the order_list. pretty much the same as
  76.                             any other trackers order list (aka sequence list).
  77.                             this table contains a list of pattern numbers
  78.                             to be played in a given order.
  79.  
  80. break_list      270 | 128 | the break list is like the 669 break list (this
  81.                             concept was stollen from the 669 format). A break
  82.                             order is a value that tells the tracker to stop
  83.                             playing a pattern when it reaches a given line
  84.                             number in the pattern. When is reaches it, it
  85.                             will then proceed to the next pattern in the
  86.                             order list.
  87.                             In the table we have 128 break numbers of each of
  88.                             the 128 possible patterns (all respectively
  89.                             ordered).
  90.  
  91.  
  92. SAMPLE BLOCK DATA
  93. -----------------
  94.  
  95. after the header, we then have our 64 sample entries stored. each sample
  96. record/set is 32 bytes. you can calc each one with a simple EAX SHL 5:
  97.  
  98. sname       (SAMPLE NUMBER * 32) + 398 | 19| sample name (19 bytes)
  99. start       (SAMPLE NUMBER * 32) + 402 | 4 | sample loop start pointer (in units)
  100. length      (SAMPLE NUMBER * 32) + 406 | 4 | lenght (in units) of sample
  101. volume      (SAMPLE NUMBER * 32) + 407 | 1 | 0->255
  102. balance     (SAMPLE NUMBER * 32) + 408 | 1 | 00 <- 80 -> FF
  103. pt_and_sop  (SAMPLE NUMBER * 32) + 409 | 1 | port type & Sample offs shifter
  104.  
  105.  
  106. MS              LS
  107.  
  108.  7 6 5 4 3 2 1 0
  109.  
  110.  \...../ \...../
  111.   port    sample
  112.   type     offs factor  (see FUNK.WRI)
  113.  
  114. vv_waveform  (SAMPLE NUMBER * 32) + 410 | 1 | Vibrito Waveform & Tremolo
  115. waveform
  116.  
  117. MS              LS
  118.  
  119.  7 6 5 4 3 2 1 0
  120.  
  121.  \...../ \...../
  122.   vibrato tremola
  123.   WF       WF  (see FUNK.WRI)
  124.  
  125. rl_and_as  (SAMPLE  NUMBER  * 32) + 411  |  1 | Retrig number & arpeggio
  126. speed
  127.  
  128. MS              LS
  129.  
  130.  7 6 5 4 3 2 1 0
  131.  
  132.  \...../ \...../
  133.   retrig  arpeggio
  134.   no      speed (see FUNK.WRI)
  135.  
  136.  
  137.  
  138. Pattern Data
  139. =-=-=-=-=-=-
  140.  
  141. Each  pattern  block  is 600h bytes - 8  by  64  slot. Each slot has the
  142. following format:
  143.  
  144.  00000000 11111111 22222222
  145.  \    /\     /\  / \      /
  146.   note  sample com  command value
  147.  
  148.  - if note:  = 3D, then reload sample attrs
  149.              = 3F, then it's a null slot
  150.              = 3E, then sample only slot
  151.  
  152.  
  153. basically,   it's  the  same  as  the  669  format  accept  you  have  3
  154. additional/different note values:
  155.  
  156. 3E, then sample only slot
  157. -------------------------
  158.  
  159. if  the 1st byte is this value, then it's a "sample only" slot. play the
  160. slot  at the last note played (in  the chan_info). decode the sample and
  161. commands and active them. etc.
  162.  
  163. 3F, then it's a null slot
  164. -------------------------
  165.  
  166. this  means..null  slot. only commands can  be used with these slots. no
  167. sample or note processing is preformed.... basically a "blank" slot.
  168.  
  169. 3D, then reload sample attrs
  170. ----------------------------
  171.  
  172. when  the  tracker  see's  one of these,  it  will  decode the sample as
  173. normal...  it will "reuse" the following attributes from the last sample
  174. (block) played:
  175.  
  176. volume      (SAMPLE NUMBER * 32) + 407 | 1 | 0->255
  177. balance     (SAMPLE NUMBER * 32) + 408 | 1 | 00 <- 80 -> FF
  178. pt_and_sop  (SAMPLE NUMBER * 32) + 409 | 1 | port type & Sample offs shifter
  179. vv_waveform (SAMPLE NUMBER * 32) + 410 | 1 | Vibrito Waveform & Tremolo waveform
  180. rl_and_as   (SAMPLE NUMBER * 32) + 411 | 1 | Retrig number & arpeggio speed
  181.  
  182.  
  183. Commands
  184. --------
  185.  
  186.  Full Commands                              Command 'O'
  187.  
  188.  A  :Frequency Port Up                      O00:Vibrato Sine
  189.  B  :Frequency Port Dn                      O01:Vibrato Triangle
  190.  C  :Frequency Porta                        O02:Vibrato Square
  191.  D  :Frequency Vibrato                      O03:Vibrato Sawtooth
  192.  E  :Freq Vibrato Fanin                     O04:Vibrato Random
  193.  F  :Freq Vibrato Fanout                    O05:tremola Sine
  194.  G  :Volume Sld Up                          O06:tremola Triangle
  195.  H  :Volume Slide Down                      O07:tremola Square
  196.  I  :Volume Porta                           O08:tremola Sawtooth
  197.  J  :Volume Reverb                          O09:tremola Random
  198.  K  :Tremola                                O0A:Halt Note System
  199.  L  :Arpeggio                               O0B:Halt Volume System
  200.  M  :Sample Offset                          O0C:Halt All Systems
  201.  N  :Volume                                 O0D:Invert Funkcrtl
  202.                                             O0E:Snap to log Porting
  203.                                             O0F:Snap to Line Porting
  204.                                             O1 :Volume Cut!
  205.                                             O2 :Real Frequency Adjust
  206.                                             O3 :Set Arpeggio Speed
  207.                                             O4 :Fine Port Up
  208.                                             O5 :Fine Port Dn
  209.                                             O6 :Fine Volume Slide Up
  210.                                             O7 :Fine Volume Slide Dn
  211.                                             O8 :Volume Crest
  212.                                             O9 :Volume Trough
  213.                                             OA :Set Master Volume
  214.                                             OB :Expand Loop
  215.                                             OC :Colapse Loop
  216.                                             OD :Note Retrig
  217.                                             OE :Set Channel Balance
  218.                                             OF :Tempo
  219.  
  220.  
  221.  
  222.